#ifndef searchfield_h
#define searchfield_h

#include "juce_amalgamated.h"
#include <vector>

using std::vector;

class ListPanel;

class SearchField: public Component, public Timer
{
private:
	ListPanel* panel;
	String searchString;
	bool focused;
	bool blink;
	bool selectingAll;
	String defaultString;

public:
	SearchField(ListPanel* lp, String str);
	void tokenize(String& s, vector<String>& list);
	const String getText() const;
	void setText(const String& text);
	bool keyPressed(const KeyPress& k);
	void paint(Graphics& g);
	void focusGained(FocusChangeType f);
	void focusLost(FocusChangeType f);
	void timerCallback();
	void mouseDoubleClick(const MouseEvent& e);
	void mouseDown(const MouseEvent& e);
};

#endif
